<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
  String _id=request.getParameter("_");
%>

<div class="row">
    <div class="col-lg-12">
        <div class="panel">
            <div class="panel-heading">
                <h3 class="panel-title">资产采购登记表</h3>
            </div>

            <!-- BASIC FORM ELEMENTS -->
            <!--===================================================-->
            <form id="form_purchase_input" class="panel-body form-horizontal form-padding">
                <input type="hidden" name="keyId" id="keyId" value="${purchase.id}" />
                <input type="hidden" name="numStatus" id="numStatus" value="${purchase.numStatus}" />

                <div class="form-group">
                    <label class="col-md-2 control-label">
                        申请部门
                        <i class="fa fa-asterisk txt-color-red"></i>
                    </label>
                    <div class="col-md-6">
                        <input type="text" id="deptName" name="deptName" class="form-control" disabled value="${purchase.issueDepartment.name}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">申请事由<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-6">
                        <input type="text" id="applyReason" name="applyReason" class="form-control"
                               value="${purchase.applyReason}" readonly >
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-1 control-label">序号</label>
                    <label class="col-md-3 control-label" style="text-align: center">资产名称<i class="fa fa-asterisk txt-color-red"></i></label>
                    <label class="col-md-1 control-label" style="text-align: center">预算金额<i class="fa fa-asterisk txt-color-red"></i></label>
                    <label class="col-md-1 control-label" style="text-align: center">实际采购金额<i class="fa fa-asterisk txt-color-red"></i></label>
                    <label class="col-md-2 control-label" style="text-align: center">采购日期<i class="fa fa-asterisk txt-color-red"></i></label>
                </div>

                <div id="itemRows">
                    <c:forEach var="item" items="${purchase.purchaseItems}" varStatus="status">
                        <div class="form-group" id="itemRow1">
                            <label class="col-md-1 control-label">${status.index + 1}</label>
                            <div class="col-md-3">
                                <input type="text" name="itemName" class="form-control" value="${item.name}" readonly>
                            </div>
                            <div class="col-md-1">
                                <input type="number" name="itemPlanMoney" class="form-control" value="${item.planMoney}" readonly>
                            </div>
                            <div class="col-md-1">
                                <input type="number" name="itemFactMoney" class="form-control" value="${item.factMoney}" readonly>
                            </div>
                            <div class="col-md-2">
                                <div class="input-group date">
                                    <input type="text" name="itemDatPurchase" class="form-control" value="<fmt:formatDate pattern="yyyy-MM-dd" value="${item.datPurchase}" />" disabled>
                                    <span class="input-group-addon"><i class="ti-calendar"></i></span>
                                </div>
                            </div>
                        </div>
                    </c:forEach>
                </div>

                <div class="form-group">
                    <label class="col-md-4 control-label">金额合计（元）</label>
                    <div class="col-md-1">
                        <input type="text" id="planMoneySum" name="planMoneySum" class="form-control" disabled value="${purchase.planMoneySum}">
                    </div>
                    <div class="col-md-1">
                        <input type="text" id="factMoneySum" name="factMoneySum" class="form-control" disabled value="${purchase.factMoneySum}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">其他需要说明情况</label>
                    <div class="col-md-6">
                        <input type="text" id="memo" name="memo" class="form-control" value="${purchase.memo}" readonly>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">提交人</label>
                    <div class="col-md-2">
                        <p class="form-control-static">${purchase.creater.name}</p>
                    </div>
                    <label class="col-md-2 control-label">提交日期</label>
                    <div class="col-md-2">
                        <p class="form-control-static"><fmt:formatDate pattern="yyyy-MM-dd" value="${purchase.dateApply}" /></p>
                    </div>
                </div>
            </form>
            <!--===================================================-->
            <!-- END BASIC FORM ELEMENTS -->

            <div class="panel-footer">
                <a class="btn btn-default" id="apply-re-common" href="javascript:void(0)">
                    <i class="fa fa-lg fa-mail-reply"></i> 返回视图
                </a>
            </div>
        </div>
    </div>
</div>

<script>

    //返回视图
    $("#apply-re-common").click(returnToHashUrl);

    // 加载完成后执行
    $(function(){

    })

</script>




